<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::any('getOpenid', 'LoginController@getOpenid'); //获取openid
Route::post('dologin', 'LoginController@login'); //登录提交

Route::post('/printMsg', 'PayController@printMsg'); //图片列表
Route::any('/notify', 'PayController@notify')->name('notify');//回调
Route::any('/payNotify', 'PayController@payNotify')->name('payNotify');//回调

Route::middleware('WeixinLogin')->group(function () {
	Route::get('/Banner', 'IndexController@Banner'); //图片列表
Route::get('/Category', 'CategoryController@Category'); //分类列表
Route::get('/Product/{id}', 'ProductController@Product'); //产品列表 传分类id
Route::any('/payJuhe', 'PayController@payJuhe')->name('payJuhe');
Route::get('/ProductDapei', 'ProductController@ProductDapei'); //产品列表 自选套餐  列表
Route::get('/Dapei', 'ProductController@Dapei'); //产品搭配 方式
Route::post('/DapeiAddCart', 'DapeiCartController@AddCart'); //产品搭配 加入购物车
Route::post('/DapeiReduceCart', 'DapeiCartController@ReduceCart'); //产品搭配 -购物车
Route::post('/XuniProduct', 'DapeiCartController@XuniProduct'); //生成虚拟商品

Route::get('/ProductInfo/{id}', 'ProductController@ProductInfo'); //产品详情 传产品id
Route::get('/Cart', 'CartController@Cart'); //购物车列表
Route::post('/AddCart', 'CartController@AddCart'); //添加购物车操作  传proid(商品id)
Route::post('/ReduceCart', 'CartController@ReduceCart'); //减购物车修改操作 传cartid(购物车id) num商品购买数量(你计算后的)
Route::post('/CartDel', 'CartController@CartDel'); //清空购物车 传cartid(购物车id  例如 1,2,3,4) 
Route::get('/UserInfo', 'UserController@UserInfo'); //用户信息
Route::get('/UserBalance', 'UserController@UserBalance'); //用户信息
Route::get('/UserLog', 'UserController@UserLog'); //消费记录
Route::get('/UserPrefer', 'UserController@UserPrefer'); //用户优惠券
Route::post('/UserOrder', 'UserController@UserOrder'); //用户订单  传state 状态 1未支付 2已支付 3已完成 4已退款
Route::get('/UserOrderInfo/{id}', 'UserController@UserOrderInfo'); //用户订单详情  传订单id
Route::get('/Contact', 'UserController@Contact'); //联系我们
Route::get('/Address', 'AddressController@Address'); //地址列表
Route::post('/AddressAdd', 'AddressController@AddressAdd'); //地址添加 详情请看数据库
Route::get('/AddressEdit/{id}', 'AddressController@AddressEdit'); //地址修改显示
Route::post('/AddressUpdate', 'AddressController@AddressUpdate'); //地址格修改操作 详情请看数据库
Route::get('/AddressDel/{id}', 'AddressController@AddressDel'); //地址删除
Route::get('/RestaurantAddress', 'AddressController@RestaurantAddress'); //地址删除
Route::post('/OrderCreate', 'OrderController@OrderCreate'); //创建订单
Route::post('/OrderUpdate', 'OrderController@OrderUpdate'); //修改订单
Route::get('/CountOrder', 'OrderController@CountOrder'); //用户第几个购买
Route::post('/OrderQx', 'OrderController@OrderQx'); //取消订单操作 传订单id 

Route::get('/Recharge', 'RechargeController@Recharge'); //充值规则
Route::any('/pay', 'PayController@pay')->name('pay');//支付 传type 1微信支付 2余额 3充值  orderid订单id(充值不传)  price支付价格 
Route::get('/send/{formId}', 'PayController@send')->name('send');//推送消息
});